Bugfix/fix training report close button on windows #272
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix "training report close button disabled on windows"
it turns out this problem, which was specific to Windows, was related to some code that temporarily changed window flags and forced the dialog to redisplay in an attempt to ensure it popped up as the active window when training finished if it was already open and hidden behind the main window
This code was actually unnecessary, because I had changed the implementation to close the dialog and reopen it (while restoring geometry and position) to force it to the top If (and only if) JABS is the active application. If JABS does not have focus, then the window content is updated wherever it is without forcing it to the top. The problematic code was remaining in the code path related to opening the dialog when one does not already exist, in which case if JABS is the active application it should appear on top of the Main Window anyway and if jabs is not the active application, we shouldn't be forcing it to the top anyway.
This pull request removes a bunch of code that fiddled with the window state, and let the OS & Qt handle it however it wants and also adds some additional window flags to ensure the desired window configuration.
fixes #271
Tested on Windows and macOS